cmake_minimum_required(VERSION 3.31)
project(llvmdemo)
set(CMAKE_CXX_STANDARD 20)

find_package(LLVM REQUIRED CONFIG)
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})

add_executable(llvmdemo main.cpp)

llvm_map_components_to_libnames(LLVM_LIBS
        Core
        Support
        IRReader
)
target_link_libraries(llvmdemo ${LLVM_LIBS})